<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 公告信息数据表
 *
 * Date: 21/03/2018
 * @author George
 */
class CreateAnnouncementsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('announcements', function (Blueprint $table) {
			$table->increments('id');
			$table->string('title')->comment('标题');
			$table->text('content')->comment('内容');
            $table->unsignedInteger('user_id')->index()->comment('作者ID');
            $table->unsignedTinyInteger('type')->default(0)->comment(' 0通知   1其他');
			$table->timestamp('published_at')->comment('发布时间');
			$table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('announcements');
    }
}
